﻿using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace RazorWebApp.Utils.RazorExtension
{
    public static class HtmlHelperExtensions
    {
        /// <summary>
        /// 构建一个换3行的扩展方法
        /// </summary>
        /// <param name="helper"></param>
        /// <returns></returns>
        public static IHtmlContent Br(this IHtmlHelper helper)
        {
            return new HtmlString("</br></br></br>");
        }

        /// <summary>
        /// 扩展img方法
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="src"></param>
        /// <returns></returns>
        public static IHtmlContent Img(this IHtmlHelper helper,string src)
        {
            return new HtmlString($"<img src='{src}'/>");
        }


    }
}
